#include "cpu/exec/template-start.h"

#define instr lods
//加载字符串，后缀由SUFFIX决定
make_helper(concat(lods_n_, SUFFIX)){
    //从地址寄存器读取数据并加载至EAX寄存器
    REG(R_EAX) = swaddr_read(reg_l(R_ESI), DATA_BYTE);
    //根据方向标志DF决定更新ESI寄存器
    if(cpu.eflags.DF == 0)reg_l(R_ESI) += DATA_BYTE;    //DF=0,增加ESI
    else reg_l(R_ESI) -= DATA_BYTE;                     //DF=1,减少ESI
    print_asm("lods%s", str(SUFFIX));
    return 1;
}

#include "cpu/exec/template-end.h"